﻿using SqlSugar;

namespace Zhp.Model.Design
{
    public class DesignFormModel
    {
        public long Id { get; set; }
        public string Name { get; set; }
        //public long? SourceId { get; set; }
        public string SoureceCode { get; set; }
        /// <summary>
        /// 数据源名称
        /// </summary>
        public string SourceName { get; set; }
    }

    public class DesignFormQuery : PageModel
    {

    }

    public class DesignFormEdit
    {
        public long Id { get; set; }
        public string Name { get; set; }
        //public long? SourceId { get; set; }
        public string SourceCode { get; set; }
        /// <summary>
        /// 数据源名称
        /// </summary>
        public string SourceName { get; set; }
        /// <summary>
        /// 表单配置
        /// </summary>
        public string FormConfig { get; set; }
        /// <summary>
        /// 表单样式
        /// </summary>
        public string FormStyle { get; set; }
        /// <summary>
        /// 表单字段
        /// </summary>
        public string FormItemList { get; set; }
    }

    /// <summary>
    /// 表单字段配置数据
    /// </summary>
    public class DesignFormItem
    {
        public string Id { get; set; }
        public string Group { get; set; }
        public string Type { get; set; }
        public string DataType { get; set; }
        public string Field { get; set; }
        public List<DesignFormFieldOption> Options { get; set; }
        public List<DesignFormItem> FormItemList { get; set; }
    }

    /// <summary>
    /// 表单字段数据
    /// </summary>
    public class DesignFormField
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Field { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public string DataType { get; set; }
        /// <summary>
        /// 表单字段类型
        /// </summary>
        public string FieldType { get; set; }
        /// <summary>
        /// 选项数据
        /// </summary>
        public List<DesignFormFieldOption> Options { get; set; }
    }

    public class DesignFormFieldOption
    { 
        public string Label { get; set; }
        public string Value { get; set; }
    }

    /// <summary>
    /// 选择表单下拉框
    /// </summary>
    public class DesignFormSelect
    {
        /// <summary>
        /// 表单ID
        /// </summary>
        public long FormId { get; set; }

        /// <summary>
        /// 表单名称
        /// </summary>
        public string FormName { get; set; }
    }

    public class DesignFormFieldSelect
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string FieldName { get; set; }
        /// <summary>
        /// 字段描述
        /// </summary>
        public string FieldText { get; set; }
        /// <summary>
        /// 表单字段类型
        /// </summary>
        public string FieldType { get; set; }
        /// <summary>
        /// 选项数据
        /// </summary>
        public List<DesignFormFieldOption> Options { get; set; }
    }
}
